home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / testif.zip / TESTIF.DOC < prev    next >
Text File  |  1990-10-25  |  13KB  |  374 lines

  1.  
  2. Computer Tyme TESTIF * Copyright 1989-90 by Marc Perkel
  3. All Rights Reserved * Version 1.2 * Release Date: 10-25-90
  4.  
  5. Computer Tyme * 411 North Sherman, Suite 300 * Springfield Mo. 65802
  6. (800) 548-5353 Sales * (417) 866-1222 Voice * (417) 866-1665 Data
  7.  
  8. This program is part of the Computer Tyme DOS ToolBox.
  9. For $59.95 you can get the rest of the programs.
  10.  
  11. This program tests the system and returns dos error codes that can be used
  12. to control the execution of .BAT files.
  13.  
  14. Usage: TestIf VideoMode
  15.  
  16. Example:
  17.   TESTIF VideoMode
  18.   IF ERRORLEVEL 7 GOTO MONO
  19.  
  20. This program tests the system and returns dos error codes that can be used
  21. to control the execution of .BAT files. Error codes range from 0 to 255.
  22. Within this program are commands for reading system parameters and processing
  23. them mathematically into useful error codes.
  24.  
  25.   REM This checks to see if selected screen is MONO or COLOR
  26.   TESTIF VideoMode
  27.   IF ERRORLEVEL 7 GOTO MONO
  28.   :COLOR
  29.      ....
  30.      ....
  31.      GOTO END
  32.   :MONO
  33.      ....
  34.      ....
  35.   :END
  36.  
  37. VideoMode is a Testif command that returns the current video mode. If the
  38. current mode is MONO then VideoMode returns a 7.
  39.  
  40. With this command, if you have both MONO and COLOR screens on your computer,
  41. and you want to set up a .BAT file to bring up a piece of software that is
  42. installed different for mono and COLOR, Testif makes it easy.
  43.  
  44. Testif has the capibility to test results to see if a command equals a
  45. value.
  46.  
  47.   TESTIF VideoMode = 7
  48.  
  49. Returns error code 1 if true and 0 if not true. A 1 is always returned to
  50. indicate TRUE and 0 is returned to indicate FALSE. Operators include
  51. =, [], [, ], [=, ]=. Note the square brackets replace the normal greater
  52. than and less than symbols. That is becuase MS-DOS filters these characters
  53. and therefore can't be used.
  54.  
  55.   TESTIF Year = 88 and Month = May
  56.  
  57. Testif supports all logical operators such as AND, OR, XOR, NOT. Multiple
  58. conditions can be used. Year returns the year part of the system date. Month
  59. returns the month part. May is a constant equal to 5. The error code result
  60. will be 1 for true or 0 for false.
  61.  
  62.   TESTIF MemSize / 10
  63.  
  64. MemSize returns the total memory size in K. Since this number is usually
  65. larger than 255, (the maximum error code), we devide by 10. On a 640k
  66. machine, the return code is 64. Notice that division is supported. Testif
  67. supports the mathematical operators +, -, *, /, MOD, SHL, SHR, AND, OR, XOR.
  68. All numbers are processed as signed 32 bit integers. It is up to you to
  69. keep the result between 0 and 255 for meaningful results.
  70.  
  71.   TESTIF 5*(9+3)
  72.  
  73. Interpretation is from left to right. Parentheses can be used to alter this
  74. order. The above example returns 60.
  75.  
  76.   TESTIF FreeSpace(0) ] 4000000
  77.  
  78. This checks freespace on the current drive (0). Other drives can also be
  79. checked. The result is 1 if more than 4,000,000 bytes are free.
  80.  
  81.   TESTIF FileSize TESTIF.EXE / 1000
  82.  
  83. This returns the filesize of TESTIF.EXE in K.
  84.  
  85. To test your formulas, start the line with an @ sign. Testif will print the
  86. return code on the screen.
  87.  
  88.    TESTIF @DosVersion
  89.    Return Code: 3
  90.  
  91.  
  92. TESTIF Commands:
  93.  
  94. SUN  Constant = 0
  95. MON  Constant = 1
  96. TUE  Constant = 2
  97. WED  Constant = 3
  98. THU  Constant = 4
  99. FRI  Constant = 5
  100. SAT  Constant = 6
  101.  
  102. JAN  Constant = 1
  103. FEB  Constant = 2
  104. MAR  Constant = 3
  105. APR  Constant = 4
  106. MAY  Constant = 5
  107. JUN  Constant = 6
  108. JUL  Constant = 7
  109. AUG  Constant = 8
  110. SEP  Constant = 9
  111. OCT  Constant = 10
  112. NOV  Constant = 11
  113. DEC  Constant = 12
  114.  
  115. MONO Constant = 7
  116. CO80 Constant = 3
  117. BW80 Constant = 2
  118. CO40 Constant = 1
  119. BW40 Constant = 0
  120.  
  121. VideoMode             Returns Current Video Mode
  122. VideoPage             Returns Current Video Page
  123. ScreenWidth           Returns Current Screen Width
  124. Year                  Returns System Year            (88=1988)
  125. Month                 Returns System Month
  126. Day                   Returns System Day
  127. DayOfWeek             Returns System Day of week     (0=SUN)
  128. Hour                  Returns System Hour
  129. Minute                Returns System Minute
  130. Second                Returns System Second
  131. WriteVerify           Returns if Write Verify is on
  132. DosVersion            Returns Dos Version Number
  133. MinorDosVersion       Returns Minor Dos Version Number
  134. CurrentDrive          Returns Current Drive Number   (A: = 0)
  135. Drives                Returns Number of Drives
  136. Floppies              Returns Number of Floppy Drives
  137. SerialPorts           Returns Number of Serial Ports
  138. ParellelPorts         Returns Number of Parralel Ports
  139. CapsLock              Tells if Caps Lock is on               (1=True)
  140. NumLock               Tells if Num Lock is on                (0=False)
  141. ScrollLock            Tells if Scroll Lock is on
  142. MemSize               Returns Total Memory Size in K
  143. Random                Returns a Random Number from 0 to 255.
  144. SectorsPerCluster(n)  Returns Number of Sectors per Cluster  (0=Current Drive)
  145. BytesPerSector(n)     Returns Number of Bytes per Sector     (1=A:)
  146. FreeClusters(n)       Returns Number of Free Clusters        (2=B:)
  147. TotalClusters(n)      Returns Total Number of Clusters       (3=C:)
  148. FreeSpace(n)          Returns Free Space in Bytes            (4=D:)
  149. TotalSpace(n)         Returns Total Space in Bytes
  150. Exist <FileName>      Tells if File Exists
  151. FileSize <FileName>   Returns File Sise in Bytes
  152. FileAttr <FileName>   Returns File Attribute
  153. FileDate <FileName>   Returns Date and Time as 32 bit Number
  154. Mem(A:B)              Returns Byte at A:B
  155. MemW(A:B)             Returns Word at A:B
  156. Port(A)               Returns Byte at Part A
  157.  
  158. =     True if A = B
  159. []    True if A <> B
  160. [     True if A < B
  161. ]     True if A > B
  162. [=    True if A <= B
  163. ]=    True if A >= B
  164. +     Returns A + B
  165. -     Returns A - B
  166. *     Returns A * B
  167. /     Returns A / B
  168. MOD   Returns A mod B
  169. AND   Returns A and B
  170. OR    Returns A or B
  171. XOR   Returns A xor B
  172. SHL   Returns A shl B  (Shift Left)
  173. SHR   Returns A shr B  (Shift Right)
  174. NOT   Returns not A
  175.  
  176. ==============================================================
  177.  
  178.       Information and order forms:
  179.  
  180.       ======================================================
  181.  
  182.       The Computer Tyme Dos ToolBox... Makes DOS easier for the novice,
  183.       more powerful for the professional.
  184.  
  185.       DIRECTORY MASTER is a powerful hard disk managment utility. It
  186.       brings up your hard disk files and allows you to mark selected
  187.       files so you can copy them, delete them, or move them. It also
  188.       allows you to rename files, change dates, and change attributes.
  189.       You can also run programs or set up your function keys to run
  190.       programs on selected files.
  191.  
  192.       DOLIST makes being at DOS easier. It gives you full line editing,
  193.       like a word processor, for your commands. It also stores commands
  194.       so that you can re-execute them. It remembers subdirectories and
  195.       allows you to go back to them by pressing the TAB key. It offers
  196.       programmable function keys, DOS extensions, multiple execution,
  197.       and many more features you have got to have.
  198.  
  199.       PICK DIRECTORY allows you to move through the directory system by
  200.       displaying a graphic tree and letting you use your arrow keys to
  201.       move around. It also lets you create, delete, rename, and hide
  202.       directories.
  203.  
  204.       TEDIT (from SemWare) is a powerful, easy to use full screen
  205.       editor.
  206.  
  207.       MARXTSR is a set of memory and TSR management utilities that let
  208.       you load and unload TSRs (Terminate and stay resident programs)
  209.       from memory. Utilities to list menory allocation and turn TSR's
  210.       on and off.
  211.  
  212.       And many more ... Also includes is D, a fancy directory listing
  213.       program; WHEREIS, for finding stuff on you hard disk, SORT, MOVE,
  214.       FIND, FREE, PIPEDIR, VERSION, and many more.
  215.  
  216.       The Dos Toolbox sells for $59.95.
  217.  
  218.       ======================================================
  219.  
  220.       We are also selling QEdit from Semware. QEdit is a professional
  221.       editor from Semware. TEdit is a mini version of QEdit. If you
  222.       like TEdit, You'll love QEdit.
  223.  
  224.       1-800-548-5353 Order Line
  225.